package model

// GetThread 获取合适的线程数
func (info *Info) GetThread() {
	if info.Url.IsSupport {
		info.Url.ThreadNum = 1
		return
	}
	if info.Url.ContentLength < 1024*1024*10 {
		info.Url.ThreadNum = 1
		return
	} else if info.Url.ContentLength < 1024*1024*100 {
		info.Url.ThreadNum = 2
		return
	} else if info.Url.ContentLength < 1024*1024*500 {
		info.Url.ThreadNum = 4
		return
	} else if info.Url.ContentLength < 1024*1024*1000 {
		info.Url.ThreadNum = 8
		return
	} else if info.Url.ContentLength < 1024*1024*2000 {
		info.Url.ThreadNum = 16
		return
	} else {
		info.Url.ThreadNum = 32
	}
}
